package com.joyoung.smartrobotcommon

import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.joyoung.common.L
import com.joyoung.control.toast.IToastBuilder
import com.joyoung.control.toast.Toast
import kotlinx.android.synthetic.main.content_main.*

class MainActivity : AppCompatActivity() {

	override fun onCreate(savedInstanceState: Bundle?) {
		super.onCreate(savedInstanceState)
		setContentView(R.layout.activity_main)

		//跳转到请求页
		open_request.setOnClickListener {
			startActivity(Intent(this, RequestActivity::class.java))
		}

		toast_empty_icon.setOnClickListener {
			Toast.show(this, IToastBuilder.ICON_TYPE_NONE, "没有图标")
		}
		toast_ok.setOnClickListener {

			Toast.show(this, IToastBuilder.ICON_TYPE_OK, "成功")
		}
		toast_error.setOnClickListener {
			Toast.show(this, IToastBuilder.ICON_TYPE_ERROR, "失败")
		}

		toast_alert.setOnClickListener {
			Toast.show(this, IToastBuilder.ICON_TYPE_WARN, "警告")
		}

		log_normal.setOnClickListener {
			L.i("AAA", "正常")
		}

		log_info.setOnClickListener {
			L.f().i("AAA", "带信息")
		}
		crashException.setOnClickListener {
			val ints = IntArray(5)
			val number= ints.set(5, 6)
			L.f().i("AAA", "数字${number}")
		}
	}


}
